package com.aspose.cells;

class zkt implements zagf {
   private int a;
   private int b = -1;
   private int[] c;

   zkt(Cells var1, int var2) {
      ColumnCollection var3 = var1.getColumns();
      Column var4 = var1.getColumns().b;
      if (var4 != null && var4.e()) {
         this.a = var4.getIndex();
         this.b = var4.c();
      } else {
         this.a = var2 + 1;
      }

      int var5 = var3.getCount();
      if (var5 > 0) {
         var5 = Math.min(var3.getColumnByIndex(var5 - 1).getIndex(), var2) + 1;
         this.c = new int[var5];

         int var6;
         for(var6 = 0; var6 < this.c.length; ++var6) {
            if (var6 < this.a) {
               this.c[var6] = 15;
            } else {
               this.c[var6] = this.b;
            }
         }

         for(var6 = var3.getCount() - 1; var6 > -1; --var6) {
            Column var7 = var3.getColumnByIndex(var6);
            if (var7.getIndex() < var5) {
               break;
            }
         }

         ++var6;

         for(int var9 = 0; var9 < var6; ++var9) {
            Column var8 = var3.getColumnByIndex(var9);
            if (var8.c() != -1) {
               this.c[var8.getIndex()] = var8.c();
            }
         }
      }

   }

   public int a(int var1) {
      if (this.c != null && var1 < this.c.length) {
         return this.c[var1];
      } else {
         return var1 >= this.a ? this.b : -1;
      }
   }
}
